home *** CD-ROM | disk | FTP | other *** search
GNU Info File | 1996-07-15 | 23.8 KB | 515 lines |
- This is Info file ld.info, produced by Makeinfo-1.55 from the input
- file ./ld.texinfo.
-
- START-INFO-DIR-ENTRY
- * Ld: (ld). The GNU linker.
- END-INFO-DIR-ENTRY
-
- This file documents the GNU linker LD.
-
- Copyright (C) 1991, 92, 93, 94, 95, 1996 Free Software Foundation,
- Inc.
-
- Permission is granted to make and distribute verbatim copies of this
- manual provided the copyright notice and this permission notice are
- preserved on all copies.
-
- Permission is granted to copy and distribute modified versions of
- this manual under the conditions for verbatim copying, provided also
- that the entire resulting derived work is distributed under the terms
- of a permission notice identical to this one.
-
- Permission is granted to copy and distribute translations of this
- manual into another language, under the above conditions for modified
- versions.
-
- File: ld.info, Node: MRI, Next: Index, Prev: BFD, Up: Top
-
- MRI Compatible Script Files
- ***************************
-
- To aid users making the transition to GNU `ld' from the MRI linker,
- `ld' can use MRI compatible linker scripts as an alternative to the
- more general-purpose linker scripting language described in *Note
- Command Language: Commands. MRI compatible linker scripts have a much
- simpler command set than the scripting language otherwise used with
- `ld'. GNU `ld' supports the most commonly used MRI linker commands;
- these commands are described here.
-
- In general, MRI scripts aren't of much use with the `a.out' object
- file format, since it only has three sections and MRI scripts lack some
- features to make use of them.
-
- You can specify a file containing an MRI-compatible script using the
- `-c' command-line option.
-
- Each command in an MRI-compatible script occupies its own line; each
- command line starts with the keyword that identifies the command (though
- blank lines are also allowed for punctuation). If a line of an
- MRI-compatible script begins with an unrecognized keyword, `ld' issues
- a warning message, but continues processing the script.
-
- Lines beginning with `*' are comments.
-
- You can write these commands using all upper-case letters, or all
- lower case; for example, `chip' is the same as `CHIP'. The following
- list shows only the upper-case form of each command.
-
- `ABSOLUTE SECNAME'
- `ABSOLUTE SECNAME, SECNAME, ... SECNAME'
- Normally, `ld' includes in the output file all sections from all
- the input files. However, in an MRI-compatible script, you can
- use the `ABSOLUTE' command to restrict the sections that will be
- present in your output program. If the `ABSOLUTE' command is used
- at all in a script, then only the sections named explicitly in
- `ABSOLUTE' commands will appear in the linker output. You can
- still use other input sections (whatever you select on the command
- line, or using `LOAD') to resolve addresses in the output file.
-
- `ALIAS OUT-SECNAME, IN-SECNAME'
- Use this command to place the data from input section IN-SECNAME
- in a section called OUT-SECNAME in the linker output file.
-
- IN-SECNAME may be an integer.
-
- `ALIGN SECNAME = EXPRESSION'
- Align the section called SECNAME to EXPRESSION. The EXPRESSION
- should be a power of two.
-
- `BASE EXPRESSION'
- Use the value of EXPRESSION as the lowest address (other than
- absolute addresses) in the output file.
-
- `CHIP EXPRESSION'
- `CHIP EXPRESSION, EXPRESSION'
- This command does nothing; it is accepted only for compatibility.
-
- `END'
- This command does nothing whatever; it's only accepted for
- compatibility.
-
- `FORMAT OUTPUT-FORMAT'
- Similar to the `OUTPUT_FORMAT' command in the more general linker
- language, but restricted to one of these output formats:
-
- 1. S-records, if OUTPUT-FORMAT is `S'
-
- 2. IEEE, if OUTPUT-FORMAT is `IEEE'
-
- 3. COFF (the `coff-m68k' variant in BFD), if OUTPUT-FORMAT is
- `COFF'
-
- `LIST ANYTHING...'
- Print (to the standard output file) a link map, as produced by the
- `ld' command-line option `-M'.
-
- The keyword `LIST' may be followed by anything on the same line,
- with no change in its effect.
-
- `LOAD FILENAME'
- `LOAD FILENAME, FILENAME, ... FILENAME'
- Include one or more object file FILENAME in the link; this has the
- same effect as specifying FILENAME directly on the `ld' command
- line.
-
- `NAME OUTPUT-NAME'
- OUTPUT-NAME is the name for the program produced by `ld'; the
- MRI-compatible command `NAME' is equivalent to the command-line
- option `-o' or the general script language command `OUTPUT'.
-
- `ORDER SECNAME, SECNAME, ... SECNAME'
- `ORDER SECNAME SECNAME SECNAME'
- Normally, `ld' orders the sections in its output file in the order
- in which they first appear in the input files. In an
- MRI-compatible script, you can override this ordering with the
- `ORDER' command. The sections you list with `ORDER' will appear
- first in your output file, in the order specified.
-
- `PUBLIC NAME=EXPRESSION'
- `PUBLIC NAME,EXPRESSION'
- `PUBLIC NAME EXPRESSION'
- Supply a value (EXPRESSION) for external symbol NAME used in the
- linker input files.
-
- `SECT SECNAME, EXPRESSION'
- `SECT SECNAME=EXPRESSION'
- `SECT SECNAME EXPRESSION'
- You can use any of these three forms of the `SECT' command to
- specify the start address (EXPRESSION) for section SECNAME. If
- you have more than one `SECT' statement for the same SECNAME, only
- the *first* sets the start address.
-
- File: ld.info, Node: Index, Prev: MRI, Up: Top
-
- Index
- *****
-
- * Menu:
-
- * ": Symbols.
- * *( COMMON ): Section Placement.
- * *(SECTION): Section Placement.
- * -(: Options.
- * -architecture=ARCH: Options.
- * -cref: Options.
- * -defsym SYMBOL=EXP: Options.
- * -discard-all: Options.
- * -discard-locals: Options.
- * -dynamic-linker FILE: Options.
- * -entry=ENTRY: Options.
- * -force-exe-suffix: Options.
- * -format=FORMAT: Options.
- * -gpsize: Options.
- * -help: Options.
- * -just-symbols=FILE: Options.
- * -library-path=DIR: Options.
- * -library=ARCHIVE: Options.
- * -mri-script=MRI-CMDFILE: Options.
- * -nmagic: Options.
- * -no-keep-memory: Options.
- * -no-whole-archive: Options.
- * -noinhibit-exec: Options.
- * -omagic: Options.
- * -output=OUTPUT: Options.
- * -print-map: Options.
- * -relax: Options.
- * -relocateable: Options.
- * -script=SCRIPT: Options.
- * -sort-common: Options.
- * -split-by-file: Options.
- * -split-by-reloc: Options.
- * -stats: Options.
- * -strip-all: Options.
- * -strip-debug: Options.
- * -trace: Options.
- * -trace-symbol=SYMBOL: Options.
- * -undefined=SYMBOL: Options.
- * -verbose: Options.
- * -version: Options.
- * -whole-archive: Options.
- * -wrap: Options.
- * -AARCH: Options.
- * -aKEYWORD: Options.
- * -assert KEYWORD: Options.
- * -b FORMAT: Options.
- * -Bdynamic: Options.
- * -Bshareable: Options.
- * -Bstatic: Options.
- * -Bsymbolic: Options.
- * -c MRI-CMDFILE: Options.
- * -call_shared: Options.
- * -d: Options.
- * -dc: Options.
- * -dn: Options.
- * -dp: Options.
- * -dy: Options.
- * -E: Options.
- * -e ENTRY: Options.
- * -EB: Options.
- * -EL: Options.
- * -embedded-relocs: Options.
- * -export-dynamic: Options.
- * -F: Options.
- * -g: Options.
- * -G: Options.
- * -hNAME: Options.
- * -i: Options.
- * -lARCHIVE: Options.
- * -LDIR: Options.
- * -M: Options.
- * -m EMULATION: Options.
- * -Map: Options.
- * -n: Options.
- * -N: Options.
- * -non_shared: Options.
- * -o OUTPUT: Options.
- * -oformat: Options.
- * -qmagic: Options.
- * -Qy: Options.
- * -r: Options.
- * -R FILE: Options.
- * -rpath: Options.
- * -rpath-link: Options.
- * -s: Options.
- * -S: Options.
- * -shared: Options.
- * -soname=NAME: Options.
- * -static: Options.
- * -t: Options.
- * -T SCRIPT: Options.
- * -Tbss ORG: Options.
- * -Tdata ORG: Options.
- * -traditional-format: Options.
- * -Ttext ORG: Options.
- * -u SYMBOL: Options.
- * -Ur: Options.
- * -v: Options.
- * -V: Options.
- * -warn-comon: Options.
- * -warn-constructors: Options.
- * -warn-multiple-gp: Options.
- * -warn-once: Options.
- * -X: Options.
- * -x: Options.
- * -Y PATH: Options.
- * -y SYMBOL: Options.
- * -z KEYWORD: Options.
- * .: Location Counter.
- * 0x: Integers.
- * :PHDR: Section Options.
- * ;: Assignment.
- * =FILL: Section Options.
- * >REGION: Section Options.
- * -relax on i960: i960.
- * ABSOLUTE (MRI): MRI.
- * ALIAS (MRI): MRI.
- * ALIGN (MRI): MRI.
- * BASE (MRI): MRI.
- * CHIP (MRI): MRI.
- * END (MRI): MRI.
- * FORMAT (MRI): MRI.
- * LIST (MRI): MRI.
- * LOAD (MRI): MRI.
- * NAME (MRI): MRI.
- * ORDER (MRI): MRI.
- * PUBLIC (MRI): MRI.
- * SECT (MRI): MRI.
- * [SECTION...], not supported: Section Placement.
- * GNU linker: Overview.
- * FILENAME: Section Placement.
- * FILENAME(SECTION): Section Placement.
- * SYMBOL = EXPRESSION ;: Section Data Expressions.
- * SYMBOL F= EXPRESSION ;: Section Data Expressions.
- * absolute and relocatable symbols: Assignment.
- * ABSOLUTE(EXP): Arithmetic Functions.
- * ADDR(SECTION): Arithmetic Functions.
- * ALIGN(EXP): Arithmetic Functions.
- * aligning sections: Section Options.
- * allocating memory: MEMORY.
- * architectures: Options.
- * archive files, from cmd line: Options.
- * arithmetic: Expressions.
- * arithmetic operators: Operators.
- * assignment in scripts: Assignment.
- * assignment, in section defn: Section Data Expressions.
- * AT ( LDADR ): Section Options.
- * back end: BFD.
- * BFD canonical format: Canonical format.
- * BFD requirements: BFD.
- * big-endian objects: Options.
- * binary input files: Option Commands.
- * binary input format: Options.
- * BLOCK(ALIGN): Section Options.
- * BYTE(EXPRESSION): Section Data Expressions.
- * C++ constructors, arranging in link: Option Commands.
- * combining symbols, warnings on: Options.
- * command files: Commands.
- * command line: Options.
- * commands, fundamental: Scripts.
- * comments: Scripts.
- * common allocation: Option Commands.
- * common allocation: Options.
- * commons in output: Section Placement.
- * compatibility, MRI: Options.
- * CONSTRUCTORS: Option Commands.
- * constructors: Options.
- * constructors, arranging in link: Option Commands.
- * contents of a section: Section Placement.
- * CREATE_OBJECT_SYMBOLS: Section Data Expressions.
- * cross reference table: Options.
- * current output location: Location Counter.
- * dbx: Options.
- * decimal integers: Integers.
- * default input format: Environment.
- * DEFINED(SYMBOL): Arithmetic Functions.
- * deleting local symbols: Options.
- * direct output: Section Data Expressions.
- * discontinuous memory: MEMORY.
- * dot: Location Counter.
- * dynamic linker, from command line: Options.
- * dynamic symbol table: Options.
- * ELF program headers: PHDRS.
- * emulation: Options.
- * endianness: Options.
- * entry point, defaults: Entry Point.
- * entry point, from command line: Options.
- * ENTRY(SYMBOL): Entry Point.
- * expression evaluation order: Evaluation.
- * expression syntax: Expressions.
- * expression, absolute: Arithmetic Functions.
- * expressions in a section: Section Data Expressions.
- * filename symbols: Section Data Expressions.
- * files and sections, section defn: Section Placement.
- * files, including in output sections: Section Placement.
- * fill pattern, entire section: Section Options.
- * FILL(EXPRESSION): Section Data Expressions.
- * first input file: Option Commands.
- * first instruction: Entry Point.
- * FLOAT: Option Commands.
- * FORCE_COMMON_ALLOCATION: Option Commands.
- * format, output file: Option Commands.
- * functions in expression language: Arithmetic Functions.
- * fundamental script commands: Scripts.
- * GNUTARGET: Option Commands.
- * GNUTARGET: Environment.
- * GROUP ( FILES ): Option Commands.
- * grouping input files: Option Commands.
- * groups of archives: Options.
- * H8/300 support: H8/300.
- * header size: Arithmetic Functions.
- * help: Options.
- * hexadecimal integers: Integers.
- * holes: Location Counter.
- * holes, filling: Section Data Expressions.
- * i960 support: i960.
- * including an entire archive: Options.
- * incremental link: Options.
- * INPUT ( FILES ): Option Commands.
- * input file format: Option Commands.
- * input filename symbols: Section Data Expressions.
- * input files, displaying: Options.
- * input files, section defn: Section Placement.
- * input format: Options.
- * input format: Options.
- * input sections to output section: Section Placement.
- * integer notation: Integers.
- * integer suffixes: Integers.
- * internal object-file format: Canonical format.
- * K and M integer suffixes: Integers.
- * l =: MEMORY.
- * L, deleting symbols beginning: Options.
- * layout of output file: Scripts.
- * lazy evaluation: Evaluation.
- * len =: MEMORY.
- * LENGTH =: MEMORY.
- * link map: Options.
- * link map: Options.
- * link-time runtime library search path: Options.
- * little-endian objects: Options.
- * load address, specifying: Section Options.
- * loading, preventing: Section Options.
- * local symbols, deleting: Options.
- * location counter: Location Counter.
- * LONG(EXPRESSION): Section Data Expressions.
- * M and K integer suffixes: Integers.
- * machine architecture, output: Option Commands.
- * machine dependencies: Machine Dependent.
- * MEMORY: MEMORY.
- * memory region attributes: MEMORY.
- * memory regions and sections: Section Options.
- * memory usage: Options.
- * MIPS embedded PIC code: Options.
- * MRI compatibility: MRI.
- * names: Symbols.
- * naming memory regions: MEMORY.
- * naming output sections: Section Definition.
- * naming the output file: Option Commands.
- * naming the output file: Options.
- * negative integers: Integers.
- * NEXT(EXP): Arithmetic Functions.
- * NMAGIC: Options.
- * NOFLOAT: Option Commands.
- * NOLOAD: Section Options.
- * Non constant expression: Assignment.
- * o =: MEMORY.
- * objdump -i: BFD.
- * object file management: BFD.
- * object files: Options.
- * object formats available: BFD.
- * object size: Options.
- * octal integers: Integers.
- * OMAGIC: Options.
- * opening object files: BFD outline.
- * Operators for arithmetic: Operators.
- * options: Options.
- * org =: MEMORY.
- * ORIGIN =: MEMORY.
- * OUTPUT ( FILENAME ): Option Commands.
- * output file after errors: Options.
- * output file layout: Scripts.
- * OUTPUT_ARCH ( BFDNAME ): Option Commands.
- * OUTPUT_FORMAT ( BFDNAME ): Option Commands.
- * partial link: Options.
- * path for libraries: Option Commands.
- * PHDRS: PHDRS.
- * precedence in expressions: Operators.
- * prevent unnecessary loading: Section Options.
- * program headers: PHDRS.
- * program headers and sections: Section Options.
- * provide: Assignment.
- * QUAD(EXPRESSION): Section Data Expressions.
- * quoted symbol names: Symbols.
- * read-only text: Options.
- * read/write from cmd line: Options.
- * regions of memory: MEMORY.
- * relaxing addressing modes: Options.
- * relaxing on H8/300: H8/300.
- * relaxing on i960: i960.
- * relocatable and absolute symbols: Assignment.
- * relocatable output: Options.
- * requirements for BFD: BFD.
- * retaining specified symbols: Options.
- * rounding up location counter: Arithmetic Functions.
- * runtime library name: Options.
- * runtime library search path: Options.
- * scaled integers: Integers.
- * script files: Options.
- * search directory, from cmd line: Options.
- * search path, libraries: Option Commands.
- * SEARCH_DIR ( PATH ): Option Commands.
- * section address: Section Options.
- * section address: Arithmetic Functions.
- * section alignment: Section Options.
- * section definition: Section Definition.
- * section defn, full syntax: Section Options.
- * section fill pattern: Section Options.
- * section size: Arithmetic Functions.
- * section start: Section Options.
- * section, assigning to memory region: Section Options.
- * section, assigning to program header: Section Options.
- * SECTIONS: SECTIONS.
- * segment origins, cmd line: Options.
- * semicolon: Assignment.
- * shared libraries: Options.
- * SHORT(EXPRESSION): Section Data Expressions.
- * SIZEOF(SECTION): Arithmetic Functions.
- * SIZEOF_HEADERS: Arithmetic Functions.
- * sizeof_headers: Arithmetic Functions.
- * specify load address: Section Options.
- * standard Unix system: Options.
- * start address, section: Section Options.
- * start of execution: Entry Point.
- * STARTUP ( FILENAME ): Option Commands.
- * strip all symbols: Options.
- * strip debugger symbols: Options.
- * stripping all but some symbols: Options.
- * suffixes for integers: Integers.
- * symbol defaults: Arithmetic Functions.
- * symbol definition, scripts: Assignment.
- * symbol names: Symbols.
- * symbol tracing: Options.
- * symbol-only input: Options.
- * symbols, from command line: Options.
- * symbols, relocatable and absolute: Assignment.
- * symbols, retaining selectively: Options.
- * synthesizing linker: Options.
- * synthesizing on H8/300: H8/300.
- * TARGET ( FORMAT ): Option Commands.
- * traditional format: Options.
- * unallocated address, next: Arithmetic Functions.
- * undefined symbol: Options.
- * undefined symbols, warnings on: Options.
- * uninitialized data: Section Placement.
- * unspecified memory: Section Data Expressions.
- * usage: Options.
- * variables, defining: Assignment.
- * verbose: Options.
- * version: Options.
- * warnings, on combining symbols: Options.
- * warnings, on undefined symbols: Options.
- * what is this?: Overview.
-
-
-